//
//  OrderDetailVC.m
//  BigJoy
//
//  Created by Rowling on 2017/7/11.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import "OrderDetailVC.h"
#import "OrderDetailHeaderView.h"
#import "OrderListCell.h"
#import "InputCell.h"
@interface OrderDetailVC ()

@end

@implementation OrderDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.XMTableview];
    self.XMTableview.height -= 50;
    OrderDetailHeaderView * headerView = [OrderDetailHeaderView fastLogin];
    headerView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 250);
    self.XMTableview.tableHeaderView = headerView;
    headerView.count = 13;
    self.XMTableview.separatorStyle = 1;
    self.baseDataArray = @[@"订单信息",@"订单号",@"下单时间",@"商品金额",@"运费",@"优惠抵扣券抵扣",@"实付金额",@"备注"];
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.baseDataArray.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    OrderListCell * cell = [OrderListCell cellWithTalbelView:tableView];
    if (indexPath.row == 0) {
        cell.rightLable.hidden = YES;
        cell.leftLable.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:13];
    } else {
        cell.leftLable.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:13];
        cell.rightLable.hidden = NO;
    }
    cell.leftLable.text = self.baseDataArray[indexPath.row];
    if (indexPath.row == self.baseDataArray.count - 1) {
        InputCell * inpuCell = [InputCell cellWithTalbelView:tableView];
        return inpuCell;
    }
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == self.baseDataArray.count - 1) {
        return 88;
    }
    return 44;
}


@end
